<template>
    <div id="app">
        <h1>我是APP组件</h1>
        <Suspense>
            <template v-slot:default>
                <Child></Child>
            </template>
            <template v-slot:fallback>
                <h3>加载中</h3>
            </template>
        </Suspense>
    </div>
</template>

<script>
// import Child from "./components/Child.vue"; //静态引入
import {defineAsyncComponent } from 'vue'
const Child = defineAsyncComponent(() => import('./components/Child.vue')) //动态引入
export default {
    name: "App",
    components: { Child },
    setup() {
        return {};
    },
};
</script>

<style>
#app {
    background-color: orange;
    padding: 10px;
}
</style>
